<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>随机颜色</title>
</head>

<body  onclick="Color(`${body}`)">
    <div id="one" style="width: 1500px; height: 1000px; "></div>
</body>
</html>
<script>
    function Color() {
        var colorSquare = document.getElementById("one");
        var r = Math.floor(Math.random() * 256);
        var g = Math.floor(Math.random() * 256);
        var b = Math.floor(Math.random() * 256);
        colorSquare.style.backgroundColor = "rgb(" + r + "," + g + "," + b + ")";
    }
</script>